﻿-var files = ViewData["files"] as IList<NotarialActionFile>
-var readOnly = false
%table{width="100%",cellspacing="3"}
  %tr
    %td{width="21%"}
      %label
        %img.icon16{src="img/attach.gif"}
        Шаблоны документов:
    %td{width="78%"}
      -if(files != null && files.Count() > 0)
        %ul#files.items
          -foreach( var file in files)
            -if(!file.IsDeleted)
              %li.file{id=string.Format("file{0}",file.Id)}
                %img.icon16{src=string.Format("img/mime/{0}_16.gif",System.IO.Path.GetExtension(file.Name).TrimStart('.'))}
                %a.noul{href=string.Format("notarialaction.ivp/viewfile/{0}",file.Id)}=file.Name
                -if (!readOnly)
                  %a.noul{href="#",onclick=string.Format("return removeFile({0});",file.Id)}
                    %img{src="img/trash.gif",title="Удалить"}
                .details=string.Format("({0})", file.Created.ToString("dd.MM.yyyy"))
      -else if (readOnly)
        ="отсутствуют"
      -if (!readOnly)
        .indent10
          %a.button{href="#",onclick="return attachFile()"}
            %img{src="img/addsmall.gif"}
            %span="Вложить документ"
      %div#addfiles
        